﻿<%@ Register TagPrefix="cc1" Namespace="GDC.Utility.Web" Assembly="ASBCC.Utility" %>

<%@ Page Language="c#" CodeBehind="CustomerInput.aspx.cs" AutoEventWireup="false"
    Inherits="BEGDC.CC.Web.Common.CustomerInput" %>

<%@ OutputCache Location="None" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <title></title>
    <base target="_self" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <link href="../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../css/style_fu.css" rel="stylesheet" type="text/css" />

    <script src="../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script type="text/javascript" src="../JS/checkform.js"></script>

    <script type="text/javascript" src="../JS/common.js"></script>

    <script src="../js/CustomerInput.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
        //        function OpenCISSearch() {
        //            var Name = escape(document.Form1.Ctl_CustomerName.value);
        //            var Title = escape(document.Form1.Ctl_Title.value);
        //            var Company = escape(document.Form1.Ctl_Company.value);

        //            if (Name == '' && Title == '' && Company == '') {
        //                alert('Please specify information about the customer');
        //                return;
        //            }

        //            var obj = window.showModalDialog('CISSearch.aspx?CISName=' + Name + '&CISTitle=' + Title + '&CISCompany=' + Company + "&IsDomestic=yes", this, 'dialogHeight:400px;dialogWidth:610px;dialogTop:px;dialogLeft:px;center:Yes;scroll:no;resizable:yes;status:no;');
        //            if (obj != null && obj != '') {
        //                document.Form1.tbReturnValue.value = obj;
        //                document.Form1.submit();
        //            }
        //            else {
        //                document.Form1.tbReturnValue.value = '';
        //            }
        //            /*
        //            if(obj =='reload')
        //            {
        //            window.returnValue='reload';
        //            window.close();
        //            //document.Form1.submit();
        //            //window.location.href = window.location.href;
        //            }
        //            else
        //            {
        //            event.returnValue = false;
        //            }	 
        //            */

        //        }

        //-->For make radio buttons act as a group
        //        var flag = 0;
        //        var lastObj;

        //        function CancelSelect(obj) {
        //            if (flag == 0) {
        //                lastObj = obj;
        //                flag += 1;
        //            }
        //            else {
        //                if (lastObj.id != obj.id) {
        //                    lastObj.checked = false;
        //                    lastObj = obj;
        //                }
        //            }
        //        }

        function test(obj) {
            var id = obj.id;
            var objs;
            if (id != " ") {
                var objs = obj.children;
            }
            document.getElementById("Ctl_CustomerName").value = objs[1].innerText;
            document.getElementById("Ctl_CustomerNamePY").value = objs[1].innerText;
            document.getElementById("Ctl_Title").value = objs[2].innerText;
            document.getElementById("Ctl_TitleEN").value = objs[2].innerText;
            document.getElementById("Ctl_Company").value = objs[3].innerText;
            document.getElementById("Ctl_CompanyEN").value = objs[3].innerText;
            document.getElementById("tbIsExist").value = 1;
        }


        $(function() {
            $('.tbody')
            .bind("click", function() {
                $('.tbody').removeClass('trhover');
                $('.tbody td input:checked').checked = false;
                $(this).addClass('trhover');
                $(this).children().first().children().first().attr("checked", "checked");
            });
        })
        
    </script>

</head>
<body>
    <h3 class="ev-header-section">
        &nbsp;Customer Infomation (客户信息)</h3>
    <form id="Form1" method="post" runat="server">
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
        <tr class="ev-row2">
            <td>
                <div class="formbox5">
                    <span class=" float_lft width200">Customer Name (客户姓名):</span> <span class=" float_lft padding_lft20">
                        <asp:TextBox ID="tbSearchName" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                    </span><span class=" float_lft padding_lft20">Customer Title (客户职务):</span> <span
                        class=" float_lft padding_lft20">
                        <asp:TextBox ID="tbSearchTitle" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                    </span>
                </div>
                <div class="formbox">
                    <span class=" float_lft  width200">Customer Company (客户公司):</span> <span class=" float_lft padding_lft20">
                        <asp:TextBox ID="tbSearchCompany" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                    </span><span class=" float_lft padding_lft20">
                        <asp:ResourceButton ID="ibtnSearch" runat="server" Text="Search" CssClass="btn" ToolTip="SearchTips" />
                    </span>
                </div>
            </td>
        </tr>
    </table>
    <table width="100%">
        <%--<tr class="ev-row2">
            <td class="val">
                &nbsp;&nbsp;<span>Customer Name</span>
                <asp:TextBox ID="tbSearchName" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                &nbsp;&nbsp;<span>Customer Title</span>
                <asp:TextBox ID="tbSearchTitle" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                &nbsp;&nbsp;<span>Customer Company</span>
                <asp:TextBox ID="tbSearchCompany" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                &nbsp;&nbsp;<asp:Button ID="ibtnSearch" runat="server" Text="Search" CssClass="btn" />
            </td>
        </tr>--%>
        <%--<tr>
            <td valign="middle" width="100%" colspan="2" height="10">
                &nbsp;
            </td>
        </tr>--%>
        <tr class="ev-row2">
            <td>
                <asp:DataGrid ID="DG_CustomerList" runat="server" PagerStyle-Visible="False" PageSize="4"
                    AllowPaging="True" AutoGenerateColumns="False" CssClass="tablestyle">
                    <AlternatingItemStyle></AlternatingItemStyle>
                    <ItemStyle CssClass="tbody"></ItemStyle>
                    <HeaderStyle CssClass="thead"></HeaderStyle>
                    <Columns>
                        <asp:TemplateColumn>
                            <ItemTemplate>
                                <asp:RadioButton ID="CB_CIS" runat="server"></asp:RadioButton>
                            </ItemTemplate>
                        </asp:TemplateColumn>
                        <asp:BoundColumn DataField="Name" HeaderText="Name<br />客户姓名"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Title" HeaderText="Title<br />职务"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Company" HeaderText="Company<br />公司"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Effects" HeaderText="Effects<br />效果" Visible="false">
                            <ItemStyle Width="150px"></ItemStyle>
                        </asp:BoundColumn>
                        <asp:BoundColumn DataField="Country" HeaderText="Country<br />国家"></asp:BoundColumn>
                        <asp:BoundColumn DataField="Province" HeaderText="Province<br />省"></asp:BoundColumn>
                        <asp:BoundColumn Visible="False" DataField="Gender" HeaderText="Gender"></asp:BoundColumn>
                    </Columns>
                    <PagerStyle Visible="False"></PagerStyle>
                </asp:DataGrid>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="padding5" align="right">
                &nbsp;&nbsp;
                <asp:ImageButton ID="btnPageFirst" runat="server" ImageUrl="../images/pg_first_inact.gif"
                    ImageAlign="AbsMiddle"></asp:ImageButton>&nbsp;
                <asp:ImageButton ID="btnPagePrev" runat="server" ImageUrl="../images/pg_pre_inact.gif"
                    ImageAlign="AbsMiddle"></asp:ImageButton>&nbsp;
                <asp:ImageButton ID="btnPageNext" runat="server" ImageUrl="../images/pg_next_inact.gif"
                    ImageAlign="AbsMiddle"></asp:ImageButton>&nbsp;
                <asp:ImageButton ID="btnPageLast" runat="server" ImageUrl="../images/pg_last_inact.gif"
                    ImageAlign="AbsMiddle"></asp:ImageButton>&nbsp; &nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table width="100%">
        <tr class="ev-row2">
            <td colspan="4" class="val">
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <span class="Star">*</span>Customer Name:<br />
                客户姓名
            </td>
            <td class="val entity-notnull-check">
                <asp:TextBox ID="Ctl_CustomerNamePY" CssClass="TEXTBOX" runat="server" MaxLength="100"
                    Width="300"></asp:TextBox>
            </td>
            <td class="title" style="display: none">
                Customer Name in PinYin:<br />
                客户姓名(拼音)
            </td>
            <td class="val" style="display: none">
                <asp:TextBox ID="Ctl_CustomerName" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
                <%-- <img id="imgSearchUser" align="middle" src="../images/Search.gif" onclick="javascript:OpenCISSearch();"
                    style="curse: hand" alt="Search Customer in CIS">&nbsp;--%>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <span class="Star">*</span>Customer Company:<br />
                客户公司
            </td>
            <td class="val entity-notnull-check">
                <asp:TextBox ID="Ctl_CompanyEN" CssClass="TEXTBOX" runat="server" MaxLength="250"
                    Width="300"></asp:TextBox>
            </td>
            <td class="title" style="display: none">
                Customer Company in EN:<br />
                客户公司(英文)
            </td>
            <td class="val" style="display: none">
                <asp:TextBox ID="Ctl_Company" CssClass="TEXTBOX" runat="server" MaxLength="50"></asp:TextBox>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                <span class="Star">*</span>Customer Title:<br />
                客户职务
            </td>
            <td class="val  entity-notnull-check">
                <asp:TextBox ID="Ctl_TitleEN" CssClass="TEXTBOX" runat="server" MaxLength="50" Width="300"></asp:TextBox>
            </td>
            <td class="title" style="display: none">
                Customer Title in EN:<br />
                客户职务(英文)
            </td>
            <td class="val" style="display: none">
                <asp:TextBox ID="Ctl_Title" CssClass="TEXTBOX" runat="server" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                Gender:<br />
                性别
            </td>
            <td class="val" colspan="3">
                <asp:RadioButtonList ID="Ctl_Gender" runat="server" RepeatDirection="Horizontal"
                    Width="120">
                    <asp:ListItem Value="1" Selected="True">Male</asp:ListItem>
                    <asp:ListItem Value="0">Female</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr class="ev-row2">
            <td class="title">
                Remark:<br />
                备注
            </td>
            <td class="val" colspan="3">
                <asp:TextBox ID="Ctl_Remark" CssClass="COMMENT" runat="server" TextMode="MultiLine"
                    MaxLength="500"></asp:TextBox>
            </td>
        </tr>
        <%--<tr>
            <td valign="top" colspan="4" height="20">
                <!--DWLayoutEmptyCell-->
                &nbsp;
            </td>
        </tr>--%>
        <tr class="ev-row2">
            <td colspan="4" style="color: Red" class="val">
                &nbsp;&nbsp;Please input customer information in CIS firstly if they can not be
                found,or you are not allowed to submit the application in normal case<br />
                &nbsp;&nbsp;请在只填写客户姓名的情况下使用查询功能;若客户在CIS中不存在, 请尽快到CIS系统中补充该客户信息(注:所填信息需与CCS中完全相同)
            </td>
        </tr>
        <tr class="ev-row2">
            <td colspan="4" class="padding5 ac">
                <asp:TextBox ID="tbReturnValue" Style="display: none" runat="server"></asp:TextBox>
                <asp:TextBox ID="tbIsExist" Style="display: none" runat="server">3</asp:TextBox>
                <asp:ResourceButton ID="Btn_Save" runat="server" Text="OK" ToolTip="OKTips" CssClass="btn customer-ok" />
                <asp:ResourceButton ID="Btn_Close" runat="server" Text="Close" ToolTip="CloseTips"
                    CssClass="btn" />
            </td>
        </tr>
        <tr class="ev-row2">
            <td colspan="4" class="val">
            </td>
        </tr>
    </table>
    </form>

    <script language="javascript" type="text/javascript">
        function OnSave() {
            if (!window.confirm(SaveInfo)) { event.returnValue = false; }
        }
        function SaveCISConfirm() {
            if (!window.confirm("The customer you are saving does not exist in CIS! Do you want to continue to save? \n 正在保存的客户不在CIS系统中! 是否要继续保存? ")) { event.returnValue = false; }
        }
        function OnDelete() {
            if (!window.confirm(DeleteItem)) { event.returnValue = false; }
        }
        function OnClose() {
            window.close();
            window.returnValue = 'close';
        }
    </script>

</body>
</html>
